package com.hmall.search;


import com.hmall.mapper.ItemClient;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;


@EnableFeignClients(clients = {ItemClient.class})
@SpringBootApplication
public class SearchApplicaion {
    public static void main(String[] args) {
        SpringApplication.run(SearchApplicaion.class,args);
    }
    @Bean
    public RestHighLevelClient client(){
        return  new RestHighLevelClient(RestClient.builder(
                HttpHost.create("http://192.168.145.128:9200")
        ));
    }
}
